package com.lqfan.bigdata.Project

import com.lqfan.bigdata.Project.business.{APPStatProcessor, AreaStatProcessor, LogETLProcessor, ProvinceCityStatProcessor}
import org.apache.spark.sql.SparkSession


/**
  * 整个项目的spark入口
  */
object SparkApp {

  def main(args: Array[String]): Unit = {

    val spark: SparkSession = SparkSession.builder()
      .master("local[2]")
      .appName("SparkApp")
      .getOrCreate()

    //STEP1:  ETL数据处理
    LogETLProcessor.process(spark)

    //STEP2:  省份地市的统计
    ProvinceCityStatProcessor.process(spark)

    //STEP3:  统计地域的广告分布情况
    AreaStatProcessor.process(spark)

    //STEP4:   统计APP的广告分布情况
    APPStatProcessor.process(spark)

    spark.stop()
  }

}
